unit EmployerMainUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DataUnit, rxPlacemnt, Menus, ContractsUnit, EmployerDataUnit,
  OrdersUnit;

type
  TEmployerMainForm = class(TForm)
    EmployerFormStorage: TFormStorage;
    EmployerMainMenu: TMainMenu;
    ContractsMenuItem: TMenuItem;
    OrdersMenuItem: TMenuItem;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure ContractsMenuItemClick(Sender: TObject);
    procedure OrdersMenuItemClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  EmployerMainForm: TEmployerMainForm;

implementation

{$R *.dfm}

procedure TEmployerMainForm.ContractsMenuItemClick(Sender: TObject);
begin
  ViewContracts(EmployerDBDataModule.DBADOConnection);
end;

procedure TEmployerMainForm.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  EmployerDBDataModule.CloseDB;
end;

procedure TEmployerMainForm.FormCreate(Sender: TObject);
var
  DBPath: string;
begin
  DBPath:= ExtractFilePath(ParamStr(0))+'database\employer.mdb';
  EmployerDBDataModule.OpenDB(DBPath);
end;

procedure TEmployerMainForm.OrdersMenuItemClick(Sender: TObject);
begin
  ViewOrders;
end;

end.
